package code;

public class Power {
    public double Solution(double base, int exponent){
        if(base==0){return 0;}
        if(base!=0&&exponent==0){return 1;}
        if(base!=0&&exponent!=0){
            if(exponent<0){
                base=1/base;
                exponent=-exponent;
            }
            double r = base;
            for(int i=1;i<exponent;i++){
                r = r * base;
            }
            return r;
       }
        return 0;
    }
}
